package org.example.mapper;


import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.example.pojo.NewsCount;
import org.example.pojo.PeriodCount;
import java.util.List;

/**
 * <p>
 * Dao层 查询newscount和periodcount所需数据
 * </p)
 * @author lczcr
 * @description
 * @data 2022/11/4 9:07
*/
@Mapper
public interface NewsMapper {
    @Select("select count(1) from newscount")
    int getNewsNum();

    @Select("select name,count from newscount order by count desc limit 10")
    List<NewsCount> getNewsList();

    @Select("select logtime,count from periodcount order by logtime desc limit 10")
    List<PeriodCount> getPeriodList();

}
